package com.example.demo.controller;

import com.example.demo.model.BlogInfo;
import com.example.demo.service.BlogInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/blog")
public class BlogInfoController {
    @Autowired
    private BlogInfoService blogInfoService;
    @RequestMapping("/getList")
    public List<BlogInfo> getList(){
        return blogInfoService.getList();

    }

    @RequestMapping("/getBlogDetail")
    public BlogInfo getBlogDetail(Integer blogId){
       return blogInfoService.getBlogDetail(blogId);

    }



}
